<?
if (!defined('IN_RJ')) die("Error 404");
if (!$logged_in && $conf['must_login_to_play']) die($lang['login_to_play']);
$id = $_GET['id'];
$type = $_GET['type'];
header("Content-Type: application/vnd.ms-wpl");
if(!$cached['wpl'][$type][$id]) {
$wpl='<?wpl version="1.0"?>
<smil>
<head>
<meta name="Generator" content="Microsoft Windows Media Player -- 10.0.0.4036"/>
<author>360phim.info</author>
<title>360phim.info</title>
</head>
<body>';
//Play Episode
if ($type == 2) {
	$r = $DB->fetch_row($DB->query("SELECT * FROM ".$conf['prefix']."media WHERE m_id IN ('".$id."')"));
	$r['m_url']=$func->unhtmlchars($r['m_url']);
	if($r['m_is_local'])
		$url=$func->get_server($r['m_is_local'],$r['m_url']);
	else{
		$type_qr=$DB->query("SELECT player_isgrab,player_img FROM ".$conf['prefix']."player WHERE player_id=".$r['m_type']);
		$type_chek=$DB->fetch_row($type_qr);
		$mms=($type_chek['player_isgrab'])?($func->grab_link($r['m_url'])):$r['m_url'];
	}	
	$wpl.='<seq>
	<media src="'.$mms.'" />
	</seq>
	</body>
	</smil>';
	$cached['wpl'][$type][$id] = $wpl;
}
}
echo $cached['wpl'][$type][$id];
exit();

?>